mkdir $1
cd $1
echo == $1 Report ==
hdjob.sh -status $1
echo === Setup Attempts ===
hdjob.sh -list-attempt-ids $1 setup completed
echo =======================
echo === Map Attempts ===
hdjob.sh -list-attempt-ids $1 map completed
echo =======================
echo === Reduce Attempts ===
hdjob.sh -list-attempt-ids $1 reduce completed
echo =======================
echo === Cleanup Attempts ===
hdjob.sh -list-attempt-ids $1 cleanup completed
echo =======================
echo == Events ==
hdjob.sh -events $1 0 10000
echo "Capturing logs to `pwd`"
hdjob.sh -events $1 0 10000 | grep http | cut -d' ' -f2,3 | xargs -n2 sh -c 'curl -s -S -o $0.STDOUT.txt $1\&filter=STDOUT \\; curl -s -S -o $0.STDERR.txt $1\&filter=STDERR \\; curl -s -S -o $0.SYSLOG.txt $1\&filter=SYSLOG'
echo =======================
cd ..
